home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 93
/
093.d81
/
rel ease source
< prev
next >
Wrap
Text File
|
2022-08-26
|
5KB
|
408 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
load =$ffd5
getin =$ffe4
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
.org $c000
.mem
.obj "@0:rel ease c000"
;dis
jmp create'rel
jmp position'at'record
jmp print'to'record
jmp write'to'record
jmp read'record'to'buffer
jmp input'record'to'buffer
jmp search'string
jmp get'error
;sys addr,name$,device,record length,max records
create'rel jsr get'name
jsr get'number
sty device
jsr get'number
sty record'length
jsr get'number
sty record'low
sta record'high
lda #0
sta offset
jsr open'error
ldy string'length
lda ","
sta buffer,y
iny
lda "l"
sta buffer,y
iny
lda ","
sta buffer,y
iny
lda record'length
sta buffer,y
iny
sty string'length
open'file lda #2
jsr close
lda #2
ldx device
ldy #2
jsr setlfs
lda string'length
ldy >buffer
ldx <buffer
jsr setnam
jsr open
jsr clrchn
jsr read'open'error
lda error'string
cmp "0"
beq +
lda #2
jsr close
lda #15
jsr close
jmp clrchn
+ jsr position
jsr clrchn
ldx #2
jsr chkout
lda #255
jsr chrout
lda #13
jsr chrout
jsr clrchn
jsr position
jsr clrchn
lda #2
jsr close
jsr clrchn
jsr read'open'error
lda #15
jmp close
open'error lda #15
jsr close
lda #15
ldx device
ldy #15
jsr setlfs
lda #3
ldy >initialize'name
ldx <initialize'name
jsr setnam
jmp open
position jsr clrchn
ldx #15
jsr chkout
lda "p"
jsr chrout
lda #2
clc
adc #96
jsr chrout
lda record'low
jsr chrout
lda record'high
jsr chrout
lda offset
jsr chrout
lda #13
jmp chrout
get'number'store'record jsr get'number
sty record'low
sta record'high
jsr get'number
sty offset
rts
write'to'record jsr get'number'store'record
jsr get'string
sta string'length
tax
beq +
jsr position
jsr clrchn
ldx #2
jsr chkout
ldy #0
- lda ($22),y
jsr chrout
iny
cpy string'length
bne -
jsr position
+ jmp clrchn
print'to'record jsr position'at'record
jsr get'string
sta string'length
tax
beq +
ldx #2
jsr chkout
ldy #0
- lda ($22),y
jsr chrout
iny
cpy string'length
bne -
lda #13
jsr chrout
jsr position
+ jmp clrchn
position'at'record jsr get'number'store'record
jsr position
jmp clrchn
input'record'to'buffer jsr position'at'record
ldx #2
jsr chkin
ldy #0
- jsr getin
cmp #13
beq +
sta buffer,y
iny
bne -
+ sty wlength
jsr position
jsr clrchn
jsr make'wstring
jmp read'open'error
read'record'to'buffer lda #0
sta offset
sta wlength
sta storage
jsr get'number
sty record'low
sta record'high
get'record jsr position
ldx #2
jsr chkin
ldy #0
- jsr getin
sta temp
jsr readst
and #64
beq +
dec storage
+ lda temp
sta buffer,y
iny
bit storage
bpl -
sty wlength
jsr position
jsr clrchn
jsr make'wstring
jmp read'open'error
;search,string,begin,offset
search'string jsr get'string
sta string'length
tax
bne +
rts
+ ldy #0
- lda ($22),y
ora #128
sta buffer,y
iny
cpy string'length
bne -
ldy #0
sty 251
sty 252
jsr get'number'store'record
start'search jsr position
ldx #15
jsr chkin
jsr getin
cmp "0"
bne search'out
jsr clrchn
ldx #2
jsr chkin
ldy #0
- jsr getin
ora #128
cmp buffer,y
bne darnit
iny
cpy string'length
bne -
lda "1"
sta 631
lda #1
sta 198
lda record'low
sta 251
lda record'high
sta 252
search'out jsr position
lda #0
sta offset
jmp read'open'error
darnit inc record'low
bne +
inc record'high
beq search'out
+ jmp start'search
get'name jsr get'string
sta string'length
tay
dey
- lda ($22),y
sta buffer,y
dey
bpl -
rts
get'error lda #15
jsr close
jsr get'number
sty device
jsr clrchn
lda #15
ldx device
ldy #15
jsr setlfs
lda #0
jsr get'string
jsr setnam
jsr open
jsr read'open'error
lda #15
jmp close
;***** get string from BASIC ****
get'string jsr $aefd
jsr $ad9e
jsr $b6a3
ldx $22
ldy $23
rts
get'number jsr $aefd
jsr $ad8a
jmp $b7f7
read'error jsr open'error
read'open'error ldx #15
jsr chkin
ldy #0
- jsr getin
sta error'string,y
iny
cmp #13
bne -
iny
sty elength
jsr clrchn
ldx <error'name
ldy >error'name
jsr locvar
lda <elength
ldy >elength
jmp set'string
locvar lda $7a
pha
lda $7b
pha
stx $7a
sty $7b
jsr $b08b
sta $49
sty $4a
pla
sta $7b
pla
sta $7a
rts
set'string sta $64
sty $65
jmp $aa52
make'wstring ldx <string'name
ldy >string'name
jsr locvar
lda <wlength
ldy >wlength
jmp set'string
string'name .asc "w$":.byt 0
wlength .byt 0
.word buffer
error'name .asc "e$":.byt 0
elength .byt 0
.word error'string
error'string .buf 50
buffer .buf 256
string'length .byt 0
number .buf 5
initialize'name .asc "i0:"
device .byt 8
error'flag .byt 0
temp .byt 0
record'low .byt 0
record'high .byt 0
offset .byt 0
record'length .byt 0
reverse .byt 0
storage .byt 0